import 'package:flutter/material.dart';
import 'package:mobile_app.core/core/presentation/theme/theme.dart';

class AppCheckbox extends StatelessWidget {
  const AppCheckbox({
    required this.value,
    required this.onChanged,
    required this.materialTapTargetSize,
    super.key,
  });

  final bool value;
  final ValueChanged<bool> onChanged;
  final MaterialTapTargetSize materialTapTargetSize;

  @override
  Widget build(BuildContext context) {
    return Checkbox(
      value: value,
      onChanged: (selected) {
        onChanged(selected!);
      },
      materialTapTargetSize: materialTapTargetSize,
      splashRadius: 0,
      activeColor: CoreTheme.of(context).primaryColor,
      checkColor: CoreTheme.of(context).primaryContrastingColor,
      autofocus: false,
      side: BorderSide(
        width: 1,
        color: CoreTheme.of(context).unselectedCheckboxBorderColor,
      ),
      shape: RoundedRectangleBorder(
        side: BorderSide(
          width: 3,
          color: CoreTheme.of(context).unselectedCheckboxBorderColor,
        ),
        borderRadius: BorderRadius.circular(5),
      ),
    );
  }
}
